#pragma once
#include "..\dxstdafx.h"
#include "..\base\Engine.h"
#include "..\utils\Logger.h"

namespace ds {

class Mesh {

public:
	Mesh(void);
	~Mesh(void);
	HRESULT loadMesh(LPCSTR fileName);
	DWORD getNumberOfMaterials();
	D3DMATERIAL9 getMaterial(DWORD index);
	LPDIRECT3DTEXTURE9 getTexture(DWORD index);
	LPD3DXMESH getMeshFile();

private:
	void DeclarationElementInsert( D3DVERTEXELEMENT9* decl, UINT before, D3DDECLTYPE type, D3DDECLUSAGE usage, BYTE index,int offset);
	LPCSTR fileName;
	LPD3DXMESH meshXFile;
	D3DMATERIAL9* pMaterials;
	LPDIRECT3DTEXTURE9* pTextures;
	DWORD numMaterials;
};

};
